<?php
$criteria = new CDbCriteria();
$criteria->order = 'sort ASC';
$menu = Menu::model()->findAllByAttributes(array('status' => 1), $criteria);
$siteInfo = SiteInfo::model()->findAll();
$siteInfo = CHtml::listData($siteInfo, 'key', 'value');

$siteSetting = SiteSetting::model()->findAll();
$siteSetting = CHtml::listData($siteSetting, 'key', 'value');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- META TAGS -->
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="robots" content="INDEX,FOLLOW" />
    <!-- MAIN HEAD -->
	<title><?php echo CHtml::encode($this->pageTitle ? $this->pageTitle . ' - Mai Hoang JSC.' : 'Trang chủ - Mai Hoang JSC.'); ?></title>
    <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/core.css" rel="stylesheet" />
    <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/styles.css" rel="stylesheet" />
    <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/slider.css" rel="stylesheet" />
    <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/css3main.css" rel="stylesheet" />
    <!--[if lt IE 9]>
        <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/fixIE.css" rel="stylesheet" />
        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/html5.js"></script>
    <![endif]-->
</head>
<body>
    <header role="info">
        <div class="head-top">
            <ul class="clearfix">
                <li><i class="icon-tel">&nbsp;</i><?php echo isset($siteInfo['tel']) ? $siteInfo['tel'] : 'siteInfo:tel'; ?></li>
                <li><i class="icon-mail">&nbsp;</i><?php echo isset($siteInfo['email_info']) ? $siteInfo['email_info'] : 'siteInfo:email_info' ?></li>
                <li><i class="icon-pin">&nbsp;</i><?php echo isset($siteInfo['address']) ? $siteInfo['address'] : 'siteInfo:address' ?></li>
            </ul>
        </div>
        <div class="container clearfix">
            <h1 class="logo"><a href="/"><?php echo isset($siteInfo['site_fullname']) ? $siteInfo['site_fullname'] : 'siteInfo:site_fullname'; ?></a></h1>
            <nav class="mainnav">
            	<?php if($menu): ?>
                <ul>
                	<?php foreach($menu as $m): ?>
                    <li><a href="<?php echo $m->link ?>"><?php echo $m->title ?></a></li>
                	<?php endforeach; ?>
                </ul>
                <?php endif; ?>
            </nav>
        </div>
        <div id="nav-thief" class="fadeIn slideFromTop">
            <div class="container">
                <h1 class="logo"><a href="/"><?php echo isset($siteInfo['site_fullname']) ? $siteInfo['site_fullname'] : 'siteInfo:site_fullname'; ?></a></h1>
                <nav class="clearfix">
                    <?php if($menu): ?>
	                <ul>
	                	<?php foreach($menu as $m): ?>
	                    <li><a href="<?php echo $m->link ?>"><?php echo $m->title ?></a></li>
	                	<?php endforeach; ?>
	                </ul>
	                <?php endif; ?>
                </nav>
            </div>
        </div>
    </header>
    <div id="wrapper">
        <?php echo $content; ?>
    </div><!-- /#wrapper -->
    <footer>
        <div class="container clearfix">
            <span class="separator">&nbsp;</span>
            <div class="foot-left">
                <h5 class="foot-logo"><?php echo isset($siteInfo['site_shortname']) ? $siteInfo['site_shortname'] : 'siteInfo:site_shortname'; ?></h5>
                <div class="foot-info">
                	<?php echo isset($siteSetting['foot_info']) ? $siteSetting['foot_info'] : 'siteSetting:foot_info'; ?>
<!--                     <p><strong>Công ty Cổ phần Mai Hoang</strong></p> -->
<!--                     <p>Trụ sở chính: Số 1 - Hồ Hoàn Kiếm - Hà Nội</p> -->
<!--                     <p>Tel: (84.4) 123.4567  Fax: (84.4) 987.6543</p> -->
<!--                     <p>E-mail: info@maihoangjsc.com</p> -->
                </div>
            </div>
            <div class="foot-right">
            	<?php echo isset($siteSetting['foot_copyright']) ? $siteSetting['foot_copyright'] : 'siteSetting:foot_copyright'; ?>
<!--                 <p>Copyright © Mai Hoang 2013. Developed by <a href="http://ownego.com">OwnEGO</a>.</p> -->
            </div>
        </div>
    </footer>
    <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/oe.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/main.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/product.js"></script>
</body>
</html>
